abstract class Game {
  abstract init(): void
  abstract startGame(): void
  abstract endGame(): void

  play() {
    this.init()
    this.startGame()
    this.endGame()
  }
}

class Cricket extends Game {
  init(): void {
    console.log('初始化 Cricket 游戏')
  }

  startGame(): void {
    console.log('开始 Cricket 游戏')
  }

  endGame(): void {
    console.log('结束 Cricket 游戏')
  }
}

class Football extends Game {
  init(): void {
    console.log('初始化 足球 游戏')
  }
  startGame(): void {
    console.log('开始 足球 游戏')
  }
  endGame(): void {
    console.log('结束 足球 游戏')
  }
}

(function () {
  let game = new Cricket()
  game.play()
  console.log('---------')
  game = new Football()
  game.play()
}())